﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Serialization;
using ExcelUtils;

namespace TestEngine.Script.Task
{
    /// <summary>
    /// A task to create a new ExcelSession object.
    /// </summary>
    [Serializable]
    public class CreateSessionTask : ScriptTask
    {       

        protected override bool RunTaskSub(ScriptState state)
        {
            if (state.IsFailed) return false;
            state.Session = new ExcelSession();
            if (ShowWindow)
            {
                state.Session.IsVisible = true;
            }
            return true;
        }

        public bool ShowWindow { get; set; }
    }
}
